<!-- 引入模板文件 -->
{% extends "public_base.html" %}
<!-- 导入自定义过滤器 -->
{% load format %}

<!-- 替换原 block content 内容 -->
{% block content %}
    <h3 style="text-align: center">Ansible 主机列表</h3>
    <table class="table table-bordered">
        <tr style="background-color:#e5dfdf">
            <td>HostName</td>
            <td>HostIP</td>
        </tr>
                {% for host in object_list %}
        <tr>
            <td>
                <a href="/ansible/get_groups/{{host.pk}}/">{{ host.hostName }}</a>
            </td>
            <td>{{host.hostIP}}</td>
        </tr>
        {% endfor %}
    </table>

{% endblock %}